//
//  MyWindowCollectionViewCell.m
//  Beauty
//
//  Created by Snow on 16/9/8.
//  Copyright © 2016年 Snow. All rights reserved.
//

#import "MyWindowCollectionViewCell.h"
#import "GXMacro.h"
@implementation MyWindowCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.contentView.layer.masksToBounds = YES;
        self.contentView.layer.borderWidth = 1;
        self.contentView.layer.borderColor = [[UIColor lightGrayColor] CGColor];
        _labelOfWindowName = [[UILabel alloc] init];
        [self.contentView addSubview:_labelOfWindowName];
        _labelOfMomentCount = [[UILabel alloc] init];
        [self.contentView addSubview:_labelOfMomentCount];

        _image1 = [[UIImageView alloc] init];
        [self.contentView addSubview:_image1];
        _image2 = [[UIImageView alloc] init];
        [self.contentView addSubview:_image2];
        _image3 = [[UIImageView alloc] init];
        [self.contentView addSubview:_image3];
        _image4 = [[UIImageView alloc] init];
        [self.contentView addSubview:_image4];
    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    [_labelOfWindowName mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.contentView.mas_top).mas_equalTo(10);
        make.left.mas_equalTo(self.contentView.mas_left).mas_equalTo(10);
        make.right.mas_equalTo(self.contentView.mas_right).mas_equalTo(-10);
        make.height.mas_equalTo(20);
    }];
    [_labelOfMomentCount mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_labelOfWindowName.mas_bottom).mas_equalTo(10);
        make.left.mas_equalTo(_labelOfWindowName.mas_left);
        make.right.mas_equalTo(_labelOfWindowName.mas_right);
        make.height.mas_equalTo(20);
    }];
    [_image1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_labelOfMomentCount.mas_bottom).mas_equalTo(10);
        make.left.mas_equalTo(self.contentView.mas_left).mas_equalTo(10);
        make.width.mas_equalTo(self.contentView.mas_width).multipliedBy(0.42);
        make.height.mas_equalTo(60);
    }];
    [_image2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_labelOfMomentCount.mas_bottom).mas_equalTo(10);
        make.left.mas_equalTo(_image1.mas_right).mas_equalTo(10);
        make.height.mas_equalTo(60);
        make.width.mas_equalTo(_image1.mas_width);
    }];
    [_image3 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_image1.mas_bottom).mas_equalTo(10);
        make.left.mas_equalTo(_image1.mas_left);
        make.width.mas_equalTo(_image1.mas_width);
        make.height.mas_equalTo(_image1.mas_height);
    }];
    [_image4 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_image2.mas_bottom).mas_equalTo(10);
        make.right.mas_equalTo(_image2.mas_right);
        make.width.mas_equalTo(_image2.mas_width);
        make.height.mas_equalTo(_image2.mas_height);
    }];
    _labelOfWindowName.font = [UIFont systemFontOfSize:18];
    _labelOfMomentCount.textColor = [UIColor grayColor];
}
@end
